package com.topscomm.main.config;


import com.topscomm.base.service.IBaseOperateRecordService;
import com.topscomm.base.service.IBasePropertyService;
import com.topscomm.mms.service.IMmsDeptExtraInfoService;
import com.topscomm.mms.service.impl.MmsDeptExtraInfoService;
import org.springframework.context.annotation.Bean;
import org.springframework.remoting.caucho.HessianServiceExporter;
import org.springframework.stereotype.Component;

import com.topscomm.base.service.IBaseChangeLogService;
import com.topscomm.mms.service.IMmsProvinceCityMatchinfoService;

import javax.annotation.Resource;

/**
 * @Description TODO
 * @Classname HessianServerConfig
 * @Date 2021/10/22
 * @Created by jiangtao
 */
@Component
public class HessianServerConfig {
	@Resource
	private IMmsProvinceCityMatchinfoService mmsProvinceCityMatchinfoService;
	@Resource
	private IBaseChangeLogService baseChangeLogService;
	@Resource
	private IBaseOperateRecordService baseOperateRecordService;
	@Resource
	private IMmsDeptExtraInfoService mmsDeptExtraInfoService;
	@Resource
	private IBasePropertyService basePropertyService;


	@Bean(name ="/bspHessian/mmsProvinceCityMatchinfoService")
	public HessianServiceExporter  exportMmsProvinceCityMatchinfoService(){
		HessianServiceExporter exporter = new HessianServiceExporter();
		exporter.setService(mmsProvinceCityMatchinfoService);
		exporter.setServiceInterface(IMmsProvinceCityMatchinfoService.class);
		return exporter;
	}

	@Bean(name ="/bspHessian/baseChangeLogService")
	public HessianServiceExporter  exportBaseChangeLogService(){
		HessianServiceExporter exporter = new HessianServiceExporter();
		exporter.setService(baseChangeLogService);
		exporter.setServiceInterface(IBaseChangeLogService.class);
		return exporter;
	}

	@Bean(name ="/bspHessian/baseOperateRecordService")
	public HessianServiceExporter  exportBaseOperateRecordService(){
		HessianServiceExporter exporter = new HessianServiceExporter();
		exporter.setService(baseOperateRecordService);
		exporter.setServiceInterface(IBaseOperateRecordService.class);
		return exporter;
	}

	@Bean(name ="/bspHessian/mmsDeptExtraInfoService")
	public HessianServiceExporter  exportMmsDeptExtraInfoService(){
		HessianServiceExporter exporter = new HessianServiceExporter();
		exporter.setService(mmsDeptExtraInfoService);
		exporter.setServiceInterface(IMmsDeptExtraInfoService.class);
		return exporter;
	}

	@Bean(name ="/bspHessian/basePropertyService")
	public HessianServiceExporter  basePropertyService(){
		HessianServiceExporter exporter = new HessianServiceExporter();
		exporter.setService(basePropertyService);
		exporter.setServiceInterface(IBasePropertyService.class);
		return exporter;
	}
}
